package LeetCode.month02.day54;
public class No222 {
    int count = 0;
    public int countNodes(TreeNode root) {
        if(root==null) return 0;
        getCount(root);
        return count;
    }

    public void getCount(TreeNode root){
        if(root==null) return;
        count++;
        getCount(root.left);
        getCount(root.right);
    }
}
